package com.lbg.drug.controller;


import com.lbg.drug.commont.untils.PageUtils;
import com.lbg.drug.commont.untils.R;
import com.lbg.drug.dto.DeliverPage;
import com.lbg.drug.dto.Deliverdto;
import com.lbg.drug.dto.StoreDto;
import com.lbg.drug.dto.StorePage;
import com.lbg.drug.entity.Deliver;
import com.lbg.drug.entity.Store;
import com.lbg.drug.mapper.DeliverMapper;
import com.lbg.drug.service.DeliverService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;

/**
 * <p>
 * 出库信息表
 * </p>
 *
 * @author lbg1
 * @since 2022-04-26
 */
@Api(value="出库信息表",tags={"出库信息表"})
@RestController
@RequestMapping("/deliver")
public class DeliverController {


    @Autowired
    private DeliverService service;



    @PostMapping("/addsock")
    public R addsock(@RequestBody Deliverdto storeDto, HttpSession session){
        String id = service.add(storeDto, session);
        return R.ok().put("id",id);
    }



    @PostMapping("/update")
    public R update(@RequestBody Deliver deliver){
        service.up(deliver);
        return R.ok();
    }



    @GetMapping("/remove")
    public R remove(String id){
        service.de(id);
        return R.ok();
    }



    @PostMapping("/getalls")
    public R getalls(@RequestBody DeliverPage storePage){
        PageUtils aLl = service.getALl(storePage);

        return R.ok().put("aLl",aLl);
    }

}

